<?php
/**
 * LeaveMsgController.class.php
 * 留言控制器
 * 
 * @author 	王中艺	<wangzy_smile@qq.com>
 * @date 	2017-05-16
 */

namespace Wechat\Controller;

class LeaveMsgController extends BaseController {

	function addItem(){
		$this->unEmptyParam(['relate_type', 'relate_id', 'content']);

		$relateType = $this->iInfo['relate_type'];
		$relateId 	= $this->iInfo['relate_id'];
		$content 	= $this->iInfo['content'];

		$result 	= D('LeaveMsg')->addItem(C('user.id'), $relateType, $relateId, $content);
		if($result === false)
			$this->outOInfo(D('LeaveMsg')->errMsg, 0);
		$this->outOInfo('Oh yes!');
	}
}